{% extends "layout.html" %}
{% load static %}



{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css' %}">
{% endblock %}

{% block content %}
{#    我的消费者数据看板#}
<div>
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">我的消费者数据看板</h3>
            </div>

            <div class="panel-body">
                <div class="row">
                    <div class="col-md-12">

                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户类型</th>
                                <th>用户名</th>
                                <th>账户余额</th>
                                <th>流水总金额</th>
                                <th>出库订单总数</th>
                                <th>点券订单总数</th>
                                <th>话费订单总数</th>
                                <th>点券金额</th>
                                <th>话费金额</th>
                                <th>系统费</th>
                            </tr>
                            </thead>

                            <tbody>


                            {% for field in queryset_consumer %}
                                <tr>
                                    <td>{{ field.id }}</td>
                                    {#  连表查询，通过外键userinfo，再查询外表userinfo的userinfo字段#}
                                    <td>{{ field.userinfo.get_usertype_display }}</td>
                                    <td>{{ field.name }}</td>
                                  <td>{{ field.userinfo.account }}</td>  {#  连表查询，通过外键userinfo，再查询外表userinfo的account字段#}
                                    <td>{{ field.total_all_fee }} </td>

                                    <td>{{ field.total_all_order_num }}</td>

                                    <td>{{ field.total_game_num }}</td>
                                    <td>{{ field.total_phone_num }}</td>

                                    <td>{{ field.total_game_fee }}</td>
                                    <td>{{ field.total_phone_fee }}</td>

                                    <td>{{ field.system_fee }}</td>
                                </tr>
                            {% endfor %}


                            </tbody>
                        </table>
                    </div>
                </div>


            </div>
        </div>
    </div>

    <div class="container">

    </div>
</div>

{#    我的供应商数据看板#}
    <div>
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">我的供应商数据看板</h3>
            </div>

            <div class="panel-body">
                <div class="row">
                    <div class="col-md-12">

                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户类型</th>
                                <th>用户名</th>
                                <th>应结算账款</th>
                                <th>流水总金额</th>
                                <th>出库订单总数</th>
                                <th>点券订单总数</th>
                                <th>话费订单总数</th>
                                <th>点券金额</th>
                                <th>话费金额</th>
                                <th>系统费</th>
                            </tr>
                            </thead>

                            <tbody>


                            {% for field in queryset_vendor %}
                                <tr>
                                    <td>{{ field.id }}</td>
                                    {#  连表查询，通过外键userinfo，再查询外表userinfo的userinfo字段#}
                                    <td>{{ field.userinfo.get_usertype_display }}</td>
                                    <td>{{ field.name }}</td>
                                  <td>{{ field.currency }}</td>
                                    <td>{{ field.total_all_fee }} </td>

                                    <td>{{ field.total_all_order_num }}</td>

                                    <td>{{ field.total_game_num }}</td>
                                    <td>{{ field.total_phone_num }}</td>

                                    <td>{{ field.total_game_fee }}</td>
                                    <td>{{ field.total_phone_fee }}</td>

                                    <td>{{ field.system_fee }}</td>
                                </tr>
                            {% endfor %}


                            </tbody>
                        </table>
                    </div>
                </div>


            </div>
        </div>
    </div>

    <div class="container">

    </div>
</div>

{#    我的客服数据看板#}
    <div>
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">我的客服数据看板</h3>
            </div>

            <div class="panel-body">
                <div class="row">
                    <div class="col-md-12">

                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户类型</th>
                                <th>用户名</th>

                                <th>流水总金额</th>
                                <th>出库订单总数</th>
                                <th>点券订单总数</th>
                                <th>话费订单总数</th>
                                <th>点券金额</th>
                                <th>话费金额</th>
                                <th>系统费</th>
                            </tr>
                            </thead>

                            <tbody>


                            {% for field in queryset_kefu %}
                                <tr>
                                    <td>{{ field.id }}</td>
                                    {#  连表查询，通过外键userinfo，再查询外表userinfo的userinfo字段#}
                                    <td>{{ field.userinfo.get_usertype_display }}</td>
                                    <td>{{ field.name }}</td>

                                    <td>{{ field.total_all_fee }} </td>

                                    <td>{{ field.total_all_order_num }}</td>

                                    <td>{{ field.total_game_num }}</td>
                                    <td>{{ field.total_phone_num }}</td>

                                    <td>{{ field.total_game_fee }}</td>
                                    <td>{{ field.total_phone_fee }}</td>

                                    <td>{{ field.system_fee }}</td>
                                </tr>
                            {% endfor %}


                            </tbody>
                        </table>
                    </div>
                </div>


            </div>
        </div>
    </div>

    <div class="container">

    </div>
</div>

{#    同级管理员数据看板#}
    <div>
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">同级管理员数据看板</h3>
            </div>

            <div class="panel-body">
                <div class="row">
                    <div class="col-md-12">

                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户类型</th>
                                <th>用户名</th>
                                <th>应付账款</th>
                                <th>流水总金额</th>
                                <th>出库订单总数</th>
                                <th>点券订单总数</th>
                                <th>话费订单总数</th>
                                <th>点券金额</th>
                                <th>话费金额</th>
                                <th>系统费</th>
                            </tr>
                            </thead>

                            <tbody>


                            {% for field in queryset_admin %}
                                <tr>
                                    <td>{{ field.id }}</td>
                                    {#  连表查询，通过外键userinfo，再查询外表userinfo的userinfo字段#}
                                    <td>{{ field.userinfo.get_usertype_display }}</td>
                                    <td>{{ field.name }}</td>
                                  <td>{{ field.currency }}</td>
                                    <td>{{ field.total_all_fee }} </td>

                                    <td>{{ field.total_all_order_num }}</td>

                                    <td>{{ field.total_game_num }}</td>
                                    <td>{{ field.total_phone_num }}</td>

                                    <td>{{ field.total_game_fee }}</td>
                                    <td>{{ field.total_phone_fee }}</td>

                                    <td>{{ field.system_fee }}</td>
                                </tr>
                            {% endfor %}


                            </tbody>
                        </table>
                    </div>
                </div>


            </div>
        </div>
    </div>

    <div class="container">

    </div>
</div>

{% endblock %}